

#region Using directives

using System;
using System.Configuration.Provider;
using System.Collections.Specialized;
using System.Data;
using System.Data.Common;
using NetROS.Tiers.Entities;
using NetROS.Tiers.Data.Bases;

#endregion

namespace NetROS.Tiers.Data.WebServiceClient
{
	/// <summary>
	/// The WebService client data provider.
	/// </summary>
	public sealed class WsNetTiersProvider : NetROS.Tiers.Data.Bases.NetTiersProvider
	{
		private static object syncRoot = new Object();
		private string _applicationName;
		private string url;
        
		/// <summary>
		/// Initializes a new instance of the <see cref="WsNetTiersProvider"/> class.
		///</summary>
		public WsNetTiersProvider()
		{			
		}
		
		/// <summary>
        /// Initializes the provider.
        /// </summary>
        /// <param name="name">The friendly name of the provider.</param>
        /// <param name="config">A collection of the name/value pairs representing the provider-specific attributes specified in the configuration for this provider.</param>
        /// <exception cref="T:System.ArgumentNullException">The name of the provider is null.</exception>
        /// <exception cref="T:System.InvalidOperationException">An attempt is made to call <see cref="M:System.Configuration.Provider.ProviderBase.Initialize(System.String,System.Collections.Specialized.NameValueCollection)"></see> on a provider after the provider has already been initialized.</exception>
        /// <exception cref="T:System.ArgumentException">The name of the provider has a length of zero.</exception>
		public override void Initialize(string name, NameValueCollection config)
        {
            // Verify that config isn't null
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            // Assign the provider a default name if it doesn't have one
            if (String.IsNullOrEmpty(name))
            {
                name = "SqlNetTiersProvider";
            }

            // Add a default "description" attribute to config if the
            // attribute doesn't exist or is empty
            if (string.IsNullOrEmpty(config["description"]))
            {
                config.Remove("description");
                config.Add("description", "NetTiers Sql provider");
            }

            // Call the base class's Initialize method
            base.Initialize(name, config);

            // Initialize _applicationName
            _applicationName = config["applicationName"];

            if (string.IsNullOrEmpty(_applicationName))
            {
                _applicationName = "/";
            }
            config.Remove("applicationName");


            #region Initialize Url
            string url  = config["url"];
           	if (string.IsNullOrEmpty(url))
            {
                throw new ProviderException("Empty or missing url");
            }
            this.url = url;
            config.Remove("url");
            #endregion

        }
        
		/// <summary>
		/// Current Url for WebService EndPoint
		/// </summary>
        public string Url
        {
        	get {return this.url;}
        	set {this.url = value;}
        }
		
		/// <summary>
		/// Creates a new <c cref="TransactionManager"/> instance from the current datasource.
		/// </summary>
		/// <returns></returns>
		public override TransactionManager CreateTransaction()
		{
			throw new NotSupportedException("Transactions are not supported by the webservice client.");
		}
		
		///<summary>
		/// Indicates if the current <c cref="NetTiersProvider"/> implementation supports Transacton.
		///</summary>
		public override bool IsTransactionSupported
		{
			get
			{
				return false;
			}
		}

			
		private WsKlijentTipProvider innerKlijentTipProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="KlijentTip"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override KlijentTipProviderBase KlijentTipProvider
		{
			get
			{
				if (innerKlijentTipProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerKlijentTipProvider == null)
						{
							this.innerKlijentTipProvider = new WsKlijentTipProvider(this.url);
						}
					}
				}
				return innerKlijentTipProvider;
			}
		}
		
			
		private WsMjestoProvider innerMjestoProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="Mjesto"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override MjestoProviderBase MjestoProvider
		{
			get
			{
				if (innerMjestoProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerMjestoProvider == null)
						{
							this.innerMjestoProvider = new WsMjestoProvider(this.url);
						}
					}
				}
				return innerMjestoProvider;
			}
		}
		
			
		private WsNacinTransportaProvider innerNacinTransportaProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="NacinTransporta"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override NacinTransportaProviderBase NacinTransportaProvider
		{
			get
			{
				if (innerNacinTransportaProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerNacinTransportaProvider == null)
						{
							this.innerNacinTransportaProvider = new WsNacinTransportaProvider(this.url);
						}
					}
				}
				return innerNacinTransportaProvider;
			}
		}
		
			
		private WsNacinPlacanjaProvider innerNacinPlacanjaProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="NacinPlacanja"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override NacinPlacanjaProviderBase NacinPlacanjaProvider
		{
			get
			{
				if (innerNacinPlacanjaProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerNacinPlacanjaProvider == null)
						{
							this.innerNacinPlacanjaProvider = new WsNacinPlacanjaProvider(this.url);
						}
					}
				}
				return innerNacinPlacanjaProvider;
			}
		}
		
			
		private WsKlijentProvider innerKlijentProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="Klijent"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override KlijentProviderBase KlijentProvider
		{
			get
			{
				if (innerKlijentProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerKlijentProvider == null)
						{
							this.innerKlijentProvider = new WsKlijentProvider(this.url);
						}
					}
				}
				return innerKlijentProvider;
			}
		}
		
			
		private WsKlijentOsobaProvider innerKlijentOsobaProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="KlijentOsoba"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override KlijentOsobaProviderBase KlijentOsobaProvider
		{
			get
			{
				if (innerKlijentOsobaProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerKlijentOsobaProvider == null)
						{
							this.innerKlijentOsobaProvider = new WsKlijentOsobaProvider(this.url);
						}
					}
				}
				return innerKlijentOsobaProvider;
			}
		}
		
			
		private WsOrganizacijaTipProvider innerOrganizacijaTipProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="OrganizacijaTip"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override OrganizacijaTipProviderBase OrganizacijaTipProvider
		{
			get
			{
				if (innerOrganizacijaTipProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerOrganizacijaTipProvider == null)
						{
							this.innerOrganizacijaTipProvider = new WsOrganizacijaTipProvider(this.url);
						}
					}
				}
				return innerOrganizacijaTipProvider;
			}
		}
		
			
		private WsValutaProvider innerValutaProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="Valuta"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override ValutaProviderBase ValutaProvider
		{
			get
			{
				if (innerValutaProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerValutaProvider == null)
						{
							this.innerValutaProvider = new WsValutaProvider(this.url);
						}
					}
				}
				return innerValutaProvider;
			}
		}
		
			
		private WsArtiklMjeraProvider innerArtiklMjeraProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="ArtiklMjera"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override ArtiklMjeraProviderBase ArtiklMjeraProvider
		{
			get
			{
				if (innerArtiklMjeraProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerArtiklMjeraProvider == null)
						{
							this.innerArtiklMjeraProvider = new WsArtiklMjeraProvider(this.url);
						}
					}
				}
				return innerArtiklMjeraProvider;
			}
		}
		
			
		private WsArtiklKategorijaProvider innerArtiklKategorijaProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="ArtiklKategorija"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override ArtiklKategorijaProviderBase ArtiklKategorijaProvider
		{
			get
			{
				if (innerArtiklKategorijaProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerArtiklKategorijaProvider == null)
						{
							this.innerArtiklKategorijaProvider = new WsArtiklKategorijaProvider(this.url);
						}
					}
				}
				return innerArtiklKategorijaProvider;
			}
		}
		
			
		private WsOrganizacijaProvider innerOrganizacijaProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="Organizacija"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override OrganizacijaProviderBase OrganizacijaProvider
		{
			get
			{
				if (innerOrganizacijaProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerOrganizacijaProvider == null)
						{
							this.innerOrganizacijaProvider = new WsOrganizacijaProvider(this.url);
						}
					}
				}
				return innerOrganizacijaProvider;
			}
		}
		
			
		private WsVezaProvider innerVezaProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="Veza"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VezaProviderBase VezaProvider
		{
			get
			{
				if (innerVezaProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerVezaProvider == null)
						{
							this.innerVezaProvider = new WsVezaProvider(this.url);
						}
					}
				}
				return innerVezaProvider;
			}
		}
		
			
		private WsTecajValuteProvider innerTecajValuteProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="TecajValute"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override TecajValuteProviderBase TecajValuteProvider
		{
			get
			{
				if (innerTecajValuteProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerTecajValuteProvider == null)
						{
							this.innerTecajValuteProvider = new WsTecajValuteProvider(this.url);
						}
					}
				}
				return innerTecajValuteProvider;
			}
		}
		
			
		private WsPorezProvider innerPorezProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="Porez"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override PorezProviderBase PorezProvider
		{
			get
			{
				if (innerPorezProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerPorezProvider == null)
						{
							this.innerPorezProvider = new WsPorezProvider(this.url);
						}
					}
				}
				return innerPorezProvider;
			}
		}
		
			
		private WsArtiklSpecifikacijaTipProvider innerArtiklSpecifikacijaTipProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="ArtiklSpecifikacijaTip"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override ArtiklSpecifikacijaTipProviderBase ArtiklSpecifikacijaTipProvider
		{
			get
			{
				if (innerArtiklSpecifikacijaTipProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerArtiklSpecifikacijaTipProvider == null)
						{
							this.innerArtiklSpecifikacijaTipProvider = new WsArtiklSpecifikacijaTipProvider(this.url);
						}
					}
				}
				return innerArtiklSpecifikacijaTipProvider;
			}
		}
		
			
		private WsBankaProvider innerBankaProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="Banka"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override BankaProviderBase BankaProvider
		{
			get
			{
				if (innerBankaProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerBankaProvider == null)
						{
							this.innerBankaProvider = new WsBankaProvider(this.url);
						}
					}
				}
				return innerBankaProvider;
			}
		}
		
			
		private WsArtiklProvider innerArtiklProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="Artikl"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override ArtiklProviderBase ArtiklProvider
		{
			get
			{
				if (innerArtiklProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerArtiklProvider == null)
						{
							this.innerArtiklProvider = new WsArtiklProvider(this.url);
						}
					}
				}
				return innerArtiklProvider;
			}
		}
		
			
		private WsArtiklSpecifikacijaProvider innerArtiklSpecifikacijaProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="ArtiklSpecifikacija"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override ArtiklSpecifikacijaProviderBase ArtiklSpecifikacijaProvider
		{
			get
			{
				if (innerArtiklSpecifikacijaProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerArtiklSpecifikacijaProvider == null)
						{
							this.innerArtiklSpecifikacijaProvider = new WsArtiklSpecifikacijaProvider(this.url);
						}
					}
				}
				return innerArtiklSpecifikacijaProvider;
			}
		}
		
			
		private WsArtiklVrijednostiProvider innerArtiklVrijednostiProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="ArtiklVrijednosti"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override ArtiklVrijednostiProviderBase ArtiklVrijednostiProvider
		{
			get
			{
				if (innerArtiklVrijednostiProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerArtiklVrijednostiProvider == null)
						{
							this.innerArtiklVrijednostiProvider = new WsArtiklVrijednostiProvider(this.url);
						}
					}
				}
				return innerArtiklVrijednostiProvider;
			}
		}
		
			
		private WsDjelatnikProvider innerDjelatnikProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="Djelatnik"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override DjelatnikProviderBase DjelatnikProvider
		{
			get
			{
				if (innerDjelatnikProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerDjelatnikProvider == null)
						{
							this.innerDjelatnikProvider = new WsDjelatnikProvider(this.url);
						}
					}
				}
				return innerDjelatnikProvider;
			}
		}
		
			
		private WsDokumentTipProvider innerDokumentTipProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="DokumentTip"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override DokumentTipProviderBase DokumentTipProvider
		{
			get
			{
				if (innerDokumentTipProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerDokumentTipProvider == null)
						{
							this.innerDokumentTipProvider = new WsDokumentTipProvider(this.url);
						}
					}
				}
				return innerDokumentTipProvider;
			}
		}
		
			
		private WsDokumentProvider innerDokumentProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="Dokument"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override DokumentProviderBase DokumentProvider
		{
			get
			{
				if (innerDokumentProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerDokumentProvider == null)
						{
							this.innerDokumentProvider = new WsDokumentProvider(this.url);
						}
					}
				}
				return innerDokumentProvider;
			}
		}
		
			
		private WsGrupaDjelatnikProvider innerGrupaDjelatnikProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="GrupaDjelatnik"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override GrupaDjelatnikProviderBase GrupaDjelatnikProvider
		{
			get
			{
				if (innerGrupaDjelatnikProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerGrupaDjelatnikProvider == null)
						{
							this.innerGrupaDjelatnikProvider = new WsGrupaDjelatnikProvider(this.url);
						}
					}
				}
				return innerGrupaDjelatnikProvider;
			}
		}
		
			
		private WsDjelatnikInGrupaProvider innerDjelatnikInGrupaProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="DjelatnikInGrupa"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override DjelatnikInGrupaProviderBase DjelatnikInGrupaProvider
		{
			get
			{
				if (innerDjelatnikInGrupaProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerDjelatnikInGrupaProvider == null)
						{
							this.innerDjelatnikInGrupaProvider = new WsDjelatnikInGrupaProvider(this.url);
						}
					}
				}
				return innerDjelatnikInGrupaProvider;
			}
		}
		
			
		private WsDokumentStavkaProvider innerDokumentStavkaProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="DokumentStavka"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override DokumentStavkaProviderBase DokumentStavkaProvider
		{
			get
			{
				if (innerDokumentStavkaProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerDokumentStavkaProvider == null)
						{
							this.innerDokumentStavkaProvider = new WsDokumentStavkaProvider(this.url);
						}
					}
				}
				return innerDokumentStavkaProvider;
			}
		}
		
		
			
		private WsVwArtiklStanjeuSkladistuProvider innerVwArtiklStanjeuSkladistuProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VwArtiklStanjeuSkladistu"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VwArtiklStanjeuSkladistuProviderBase VwArtiklStanjeuSkladistuProvider
		{
			get
			{
				if (innerVwArtiklStanjeuSkladistuProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerVwArtiklStanjeuSkladistuProvider == null)
						{
							this.innerVwArtiklStanjeuSkladistuProvider = new WsVwArtiklStanjeuSkladistuProvider(this.url);
						}
					}
				}
				return innerVwArtiklStanjeuSkladistuProvider;
			}
		}
		
		
		#region "General data access methods"

		#region "ExecuteNonQuery"
		/// <summary>
		/// Executes the non query.
		/// </summary>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override int ExecuteNonQuery(string storedProcedureName, params object[] parameterValues)
		{
			WsProxy.NetROSServices proxy = new WsProxy.NetROSServices();
			proxy.Url = this.url;
			return proxy.ExecuteNonQuery(storedProcedureName, parameterValues);
		}

		/// <summary>
		/// Executes the non query.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override int ExecuteNonQuery(TransactionManager transactionManager, string storedProcedureName, params object[] parameterValues)
		{
			throw new NotSupportedException("TransactionManager overloads are not supported by the WebService provider.");
		}

		/// <summary>
		/// Executes the non query.
		/// </summary>
		/// <param name="commandWrapper">The command wrapper.</param>
		public override void ExecuteNonQuery(DbCommand commandWrapper)
		{
			throw new NotSupportedException("DBCommandWrapper overloads are not supported by the WebService provider.");
		}

		/// <summary>
		/// Executes the non query.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandWrapper">The command wrapper.</param>
		public override void ExecuteNonQuery(TransactionManager transactionManager, DbCommand commandWrapper)
		{
			throw new NotSupportedException("DBCommandWrapper overloads are not supported by the WebService provider.");
		}


		/// <summary>
		/// Executes the non query.
		/// </summary>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override int ExecuteNonQuery(CommandType commandType, string commandText)
		{
			WsProxy.NetROSServices proxy = new WsProxy.NetROSServices();
			proxy.Url = this.url;
			return proxy.ExecuteNonQuery((WsProxy.CommandType)Enum.Parse(typeof(WsProxy.CommandType), commandType.ToString(), false), commandText);
		}
		/// <summary>
		/// Executes the non query.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override int ExecuteNonQuery(TransactionManager transactionManager, CommandType commandType, string commandText)
		{
			throw new NotSupportedException("TransactionManager overloads are not supported by the WebService provider.");
		}
		#endregion

		#region "ExecuteDataReader"
		/// <summary>
		/// Executes the reader.
		/// </summary>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override IDataReader ExecuteReader(string storedProcedureName, params object[] parameterValues)
		{
			throw new NotSupportedException("ExecuteReader methods are not supported by the WebService provider.");
		}

		/// <summary>
		/// Executes the reader.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override IDataReader ExecuteReader(TransactionManager transactionManager, string storedProcedureName, params object[] parameterValues)
		{
			throw new NotSupportedException("ExecuteReader methods are not supported by the WebService provider.");
		}

		/// <summary>
		/// Executes the reader.
		/// </summary>
		/// <param name="commandWrapper">The command wrapper.</param>
		/// <returns></returns>
		public override IDataReader ExecuteReader(DbCommand commandWrapper)
		{
			throw new NotSupportedException("ExecuteReader methods are not supported by the WebService provider.");
		}

		/// <summary>
		/// Executes the reader.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandWrapper">The command wrapper.</param>
		/// <returns></returns>
		public override IDataReader ExecuteReader(TransactionManager transactionManager, DbCommand commandWrapper)
		{
			throw new NotSupportedException("ExecuteReader methods are not supported by the WebService provider.");
		}


		/// <summary>
		/// Executes the reader.
		/// </summary>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override IDataReader ExecuteReader(CommandType commandType, string commandText)
		{
			throw new NotSupportedException("ExecuteReader methods are not supported by the WebService provider.");
		}
		/// <summary>
		/// Executes the reader.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override IDataReader ExecuteReader(TransactionManager transactionManager, CommandType commandType, string commandText)
		{
			throw new NotSupportedException("ExecuteReader methods are not supported by the WebService provider.");
		}
		#endregion

		#region "ExecuteDataSet"
		/// <summary>
		/// Executes the data set.
		/// </summary>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override DataSet ExecuteDataSet(string storedProcedureName, params object[] parameterValues)
		{
			WsProxy.NetROSServices proxy = new WsProxy.NetROSServices();
			proxy.Url = this.url;
			return proxy.ExecuteDataSet(storedProcedureName, parameterValues);
		}

		/// <summary>
		/// Executes the data set.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override DataSet ExecuteDataSet(TransactionManager transactionManager, string storedProcedureName, params object[] parameterValues)
		{
			throw new NotSupportedException("TransactionManager overloads are not supported by the WebService provider.");
		}

		/// <summary>
		/// Executes the data set.
		/// </summary>
		/// <param name="commandWrapper">The command wrapper.</param>
		/// <returns></returns>
		public override DataSet ExecuteDataSet(DbCommand commandWrapper)
		{
			throw new NotSupportedException("DBCommandWrapper overloads are not supported by the WebService provider.");
		}

		/// <summary>
		/// Executes the data set.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandWrapper">The command wrapper.</param>
		/// <returns></returns>
		public override DataSet ExecuteDataSet(TransactionManager transactionManager, DbCommand commandWrapper)
		{
			throw new NotSupportedException("DBCommandWrapper overloads are not supported by the WebService provider.");
		}


		/// <summary>
		/// Executes the data set.
		/// </summary>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override DataSet ExecuteDataSet(CommandType commandType, string commandText)
		{
			WsProxy.NetROSServices proxy = new WsProxy.NetROSServices();
			proxy.Url = this.url;
			return proxy.ExecuteDataSet((WsProxy.CommandType)Enum.Parse(typeof(WsProxy.CommandType), commandType.ToString(), false), commandText);
		}
		
		/// <summary>
		/// Executes the data set.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override DataSet ExecuteDataSet(TransactionManager transactionManager, CommandType commandType, string commandText)
		{
			throw new NotSupportedException("TransactionManager overloads are not supported by the WebService provider.");			
		}
		#endregion

		#region "ExecuteScalar"
		/// <summary>
		/// Executes the scalar.
		/// </summary>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override object ExecuteScalar(string storedProcedureName, params object[] parameterValues)
		{
			WsProxy.NetROSServices proxy = new WsProxy.NetROSServices();
			proxy.Url = this.url;
			return proxy.ExecuteScalar(storedProcedureName, parameterValues);
		}

		/// <summary>
		/// Executes the scalar.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override object ExecuteScalar(TransactionManager transactionManager, string storedProcedureName, params object[] parameterValues)
		{
			throw new NotSupportedException("TransactionManager overloads are not supported by the WebService provider.");
		}

		/// <summary>
		/// Executes the scalar.
		/// </summary>
		/// <param name="commandWrapper">The command wrapper.</param>
		/// <returns></returns>
		public override object ExecuteScalar(DbCommand commandWrapper)
		{
			throw new NotSupportedException("DBCommandWrapper overloads are not supported by the WebService provider.");
		}

		/// <summary>
		/// Executes the scalar.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandWrapper">The command wrapper.</param>
		/// <returns></returns>
		public override object ExecuteScalar(TransactionManager transactionManager, DbCommand commandWrapper)
		{
			throw new NotSupportedException("DBCommandWrapper overloads are not supported by the WebService provider.");
		}

		/// <summary>
		/// Executes the scalar.
		/// </summary>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override object ExecuteScalar(CommandType commandType, string commandText)
		{
			WsProxy.NetROSServices proxy = new WsProxy.NetROSServices();
			proxy.Url = this.url;
			return proxy.ExecuteScalar((WsProxy.CommandType)Enum.Parse(typeof(WsProxy.CommandType), commandType.ToString(), false), commandText);	
		}
		/// <summary>
		/// Executes the scalar.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override object ExecuteScalar(TransactionManager transactionManager, CommandType commandType, string commandText)
		{
			throw new NotSupportedException("TransactionManager overloads are not supported by the WebService provider.");		
		}
		#endregion

		#endregion
	}
}
